package 实现类;

import java.util.Scanner;

public class shu {
    public static void main(String[] args) {
        Scanner input =new Scanner(System.in);
        System.out.print("输入一个字符串：");
        String a=input.next();
        System.out.print("输入要查找的字符:");
        String b=input.next();
        int k=0;
        String[] p = new String[a.length()];
        for (int i=0;i<a.length();i++){
            p[i]=a.substring(i,i+1);
        }
        for (String s:p){
            if (s.equals(b)){
                k++;
            }
        }
        System.out.println(b+"有"+(k)+"个");

    }
}
